package com.supergzt.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import com.supergzt.interceptor.MybatisPlusLogicInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 张钧
 * @Description
 * @create 2023-01-09 11:35
 */
@Configuration
public class MybaitsPlusConfiguration {

	@Bean
	public MybatisPlusInterceptor mybatisPlusInterceptor(){
		MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
		interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
		return interceptor;
	}

	@Bean
	public MybatisPlusLogicInterceptor mybatisPlusLogicInterceptor(){
		return new MybatisPlusLogicInterceptor();
	}
}
